Skip to content

Fix timestamp parsing for historical data on Windows#4

Merged
traderjoe1968 merged 3 commits intotraderjoe1968:ProDatafrom
gezmisozkan:ProData
Feb 16, 2026
Merged

Fix timestamp parsing for historical data on Windows#4
traderjoe1968 merged 3 commits intotraderjoe1968:ProDatafrom
gezmisozkan:ProData

Conversation

@gezmisozkan
Copy link

Hi, I found an issue in timestamp parsing on Windows. When fetching symbols
with very old history (e.g. XAUUSD on OANDA), TradingView returns negative
Unix timestamps for pre-1970 data. datetime.fromtimestamp raises OSError on
Windows for negative values, causing get_hist to fail.

Replacing fromtimestamp with an epoch + timedelta(seconds) calculation fixes
the problem and works consistently across Windows, Linux, and macOS.

@traderjoe1968 traderjoe1968 merged commit 49713b0 into traderjoe1968:ProData Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants